package com.celan.year2023.month01.day27;

public class Solution {
    public String greatestLetter(String s) {
        char res = ' ';
        for (char c : s.toCharArray()) {
            if (c < 'A') continue;
            char low = (char) (c - 'A' + 'a');
            if (s.contains(String.valueOf(low)) && c > res) {
                res = c;
            }
        }
        return res == ' ' ? "" :String.valueOf(res);
    }
}
